#coding:UTF-8

from tkinter import *


root=Tk()

text1=Text(root,width=100,height=100)
text1.pack()


# def show():
#     print("hello,好累")
# b1=Button(text1,text="点我",command=show)

photo=PhotoImage(file=r'D:\Desktop\studypython\p65-78Tkinter\3.gif')

def show():
    text1.image_create(END,image=photo)

b1=Button(text1,text="点我",command=show)
text1.window_create(INSERT,window=b1)

mainloop()